package com.dongdongshop.controller;

import com.dongdongshop.data.Result;
import com.dongdongshop.enums.ResultEnums;
import com.dongdongshop.pojo.PageResult;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TbTypeTemplateService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("TbTypeTemplate")
public class TbTypeTemplateController {

    //注入service
    @DubboReference
    private TbTypeTemplateService tbTypeTemplateService;

    //查询单个商品类型模板
    @ResponseBody
    @RequestMapping("showbyid")
    public Result showbyid(Long id) {
        try {
            TbTypeTemplate tbTypeTemplate = tbTypeTemplateService.showbyid(id);
            return Result.response(ResultEnums.SHOW_SUCCESS).setData(tbTypeTemplate);
        } catch (Exception e) {
            return Result.response(ResultEnums.SHOW_ERROR);
        }
    }
}
